import 'package:cbec_app/entity/home/content/content_data.dart';
import 'package:cbec_app/generated/json/base/json_field.dart';
import 'package:cbec_app/generated/json/image_text_nav_entity.g.dart';
import 'dart:convert';
export 'package:cbec_app/generated/json/image_text_nav_entity.g.dart';

@JsonSerializable()
class ImageTextNavEntity extends ContentData {
  @JSONField(name: "border_width")
  int? borderWidth = 0;
  @JSONField(name: "show_method")
  String? showMethod = '';
  @JSONField(name: "background_color")
  String? backgroundColor = '';
  String? color = '';
  int? count = 0;
  @JSONField(name: "image_fill_style")
  String? imageFillStyle = '';
  @JSONField(name: "sub_entry")
  List<ImageTextNavSubEntry>? subEntry = [];
  @JSONField(name: "slide_setting")
  String? slideSetting = '';
  String? uuid = '';

  ImageTextNavEntity() {
    type = 'image_text_nav';
  }

  factory ImageTextNavEntity.fromJson(Map<String, dynamic> json) => $ImageTextNavEntityFromJson(json);

  @override
  Map<String, dynamic> toJson() => $ImageTextNavEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  ContentData fromJson(Map<String, dynamic> json) {
    return ImageTextNavEntity.fromJson(json);
  }
}

@JsonSerializable()
class ImageTextNavSubEntry {
  @JSONField(name: "link_type")
  String? linkType = '';
  @JSONField(name: "image_height")
  int? imageHeight = 0;
  @JSONField(name: "image_url")
  String? imageUrl = '';
  @JSONField(name: "link_title")
  String? linkTitle = '';
  @JSONField(name: "image_width")
  int? imageWidth = 0;
  String? title = '';
  @JSONField(name: "link_id")
  int? linkId = 0;

  ImageTextNavSubEntry();

  factory ImageTextNavSubEntry.fromJson(Map<String, dynamic> json) => $ImageTextNavSubEntryFromJson(json);

  Map<String, dynamic> toJson() => $ImageTextNavSubEntryToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
